package com.xujl.mvcbind.ui.list.control;

import android.os.Bundle;

import com.xujl.fastlib.base.BaseFragment;
import com.xujl.mvcbind.adapter.FragmentViewPagerAdapter;
import com.xujl.mvcbind.ui.list.model.TabListFragmentModel;
import com.xujl.mvcbind.ui.list.view.TabListFragmentView;

import androidx.fragment.app.FragmentPagerAdapter;

/**
 * <pre>
 *     author : xujl
 *     e-mail : 597355068@qq.com
 *     time   : 2019/08/20
 *     desc   : tab切换viewpager
 *     version: 1.0
 * </pre>
 */

public class TabListFragmentControl extends BaseFragment<TabListFragmentModel, TabListFragmentView> {
    private FragmentPagerAdapter mPagerAdapter;

    public static TabListFragmentControl newInstance () {
        Bundle args = new Bundle();
        TabListFragmentControl fragment = new TabListFragmentControl();
        fragment.setArguments(args);
        return fragment;
    }
    @Override
    public void init (Bundle savedInstanceState) {
        mPagerAdapter = new FragmentViewPagerAdapter(getChildFragmentManager(),mModel.getFragmentList(),mModel.getTitleList());
        mView.setAdapter(mPagerAdapter);
    }
}
